package model

import (
	"time"

	"gorm.io/gorm"
)

type BaseModel struct {
	ID        int32     `gorm:"primarykey"`
	CreatedAt time.Time `gorm:"column:add_time"`
	UpdatedAt time.Time `gorm:"column:update_time"`
	DeletedAt gorm.DeletedAt
	IsDeleted bool
}

// 品牌
type Brand struct {
	Id   int
	Name string
	//Good []Goods `gorm:"ForeignKey:GoodBrand"`
}

type Goods struct {
	Id          int
	GoodBrand   int
	Brand       Brand `gorm:"ForeignKey:GoodBrand"`
	GoodName    string
	SubTitle    string
	GoodPic     string
	GoodClassId int
	GoodMenu    int
	Price       float32
}

type User struct {
	Id     int
	Name   string
	DeptId int
}

type Order struct {
	Id         int
	UserId     int
	User       User `gorm:"ForeignKey:UserId"`
	OrderName  string
	CreateTime time.Time
}

type Classification struct {
	BaseModel
	Name string
}

type Menu struct {
	BaseModel
	Name string
}

type Dept struct {
	BaseModel
	DeptName string
}
